<?php
namespace Shama\Contact;
/**
 * Message send by or to the contact.
 *
 * It represant the web site site that has created the contact
 *
 * @author Xavier VILAIN
 * @package Shama\Contact
 * @license
 *
 * @property int	$contactid		Source Reference
 * @property int	$messageid		Source Reference
 * @property string	$subject		Title of the message
 * @property string	$message		Message Content
 * @property string	$author			Author of the message if empty it means the contact him self
 * @property bool	$read			Read or Not
 * @property bool	$cdate			Creation Date
 *
 */
class Message extends \Fox\Object {

	/**
	 * Link to Contact
	 */
	const LINK_CONTACT = "contact";

	protected function beforeCreate()
	{
		$this->cdate = \Fox\Object::sqlDateTime(time());
	}
}
\Fox\Dao::infos(Message::className(),new \Fox\Object\Info('contact_messages', \Fox\Databases::DB_APP))
	->addAutoIncrementField('messageid');